package com.gwc.yy.liuxue.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gwc.yy.liuxue.dao.StudentDao;
import com.gwc.yy.liuxue.entity.Student;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.common.utils.IdGen;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
@Service
@Transactional(readOnly = true)
public class StudentService extends CrudService<StudentDao, User> {
	

	@Transactional(readOnly = false)
	public void save(String student,String adviser){
		String oldSdviser=this.dao.getAdvisor(student);
		if(oldSdviser==null){
			dao.insertData(IdGen.uuid(), adviser, student);
		}else
		{
			dao.updateData(adviser, student);
		}

	}
	@Transactional(readOnly = true)
	public String getAdvisor(String student){
		return dao.getAdvisor(student);
	}
	

}
